package com.xms.security.service.dataauth;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xms.security.data.PrincipalObjectAccessMapper;
import com.xms.security.entity.PrincipalObjectAccess;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author migo
 * @since 2021-09-11
 */
@Service
public class PrincipalObjectAccessService extends ServiceImpl<PrincipalObjectAccessMapper, PrincipalObjectAccess> implements IPrincipalObjectAccessService {

    @Override
    public boolean deleteByObjectId(UUID entityId, UUID objectId) {
        return super.remove(new LambdaQueryWrapper<PrincipalObjectAccess>()
        .eq(PrincipalObjectAccess::getEntityid, entityId)
        .eq(PrincipalObjectAccess::getObjectid, objectId));
    }
}
